#ifndef __UACUTIL_H__
#define __UACUTIL_H__

#include <set>
#include <string>
#include <map>
#include "json.h"

namespace Usbstream{
#ifdef __cplusplus
extern "C" {
#endif
using namespace std;




#define devnamePrefix        "hw:"
#define uacSoundMark         "USB-Audio"
#define usbportMark          ".usb-"
#define cardsPath            "/proc/asound/cards"
#define soundDevicePath      "/dev/snd"
#define captureDeviceFormat  "pcmC%dD0c"
#define playDeviceFormat     "pcmC%dD0p"
#define deviceparams         "/proc/asound/card%d/stream0"
enum{
	UVCIN  = 0x00000001, //uvc视频流输入的能力
	UACIN = 0x00000002,  //uac输出视频流的能力
	UACOUT = 0x00000004, //Uac音频流输入的能力
};

class UacUtil{
public:
	/**
	 * 获取声卡以及配置文件中的信息
	 *
	 * */
	static bool getSoundInfo(set<string> &devicenodes, set<string> &cards);

	/**
	 * 到文件中获取当前音频设备的支持的参数信息，包括format，channels，rates等
	 * */
	static bool parseDeviceParam(int device_number, int mode, Json::Value &supportParam);

};

#ifdef __cplusplus
}
#endif

}
#endif
